home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / shllutil.lha / shellutils-1.8 / src / Makefile.in < prev    next >
Makefile  |  1992-10-28  |  5KB  |  169 lines

  1. # Makefile for GNU shell utilities programs.
  2. # Do not use this makefile directly, but only from `../Makefile'.
  3. # Copyright (C) 1991 Free Software Foundation, Inc.
  4.  
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2, or (at your option)
  8. # any later version.
  9.  
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14.  
  15. # You should have received a copy of the GNU General Public License
  16. # along with this program; if not, write to the Free Software
  17. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. SHELL = /bin/sh
  20.  
  21. srcdir = @srcdir@
  22. VPATH = @srcdir@
  23.  
  24. SOURCES = basename.c date.c dirname.c echo.c env.c expr.c id.c logname.c \
  25. pathchk.c printenv.c printf.c sleep.c su.c tee.c test.c tty.c who.c \
  26. whoami.c yes.c nice.c stty.c uname.c version.c
  27. DISTFILES = Makefile.in system.h $(SOURCES) groups.sh nohup.sh \
  28. false.sh true.sh
  29.  
  30. PROGS = basename date dirname echo env expr false groups id logname \
  31. pathchk printenv printf sleep tee test true tty who whoami yes @PROGS@
  32.  
  33. all: $(PROGS) su
  34.  
  35. .c.o:
  36.     $(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) -I$(srcdir)/../lib $<
  37.  
  38. install: all
  39.     for f in $(PROGS); do $(INSTALL_PROGRAM) $$f $(bindir)/$(binprefix)$$f; done
  40.     rm -f $(bindir)/'['; ln $(bindir)/$(binprefix)test $(bindir)/'['
  41.     @if test `./id -u` = 0; then \
  42.     echo you are root, so installing su; \
  43.     $(INSTALL_PROGRAM) su $(bindir)/$(binprefix)su; \
  44.     chown root $(bindir)/$(binprefix)su; \
  45.     chmod 4755 $(bindir)/$(binprefix)su; \
  46.     else echo you are not root, so not installing su; fi
  47.  
  48. uninstall:
  49.     for f in $(PROGS) su; do rm -f $(bindir)/$(binprefix)$$f; done
  50.     rm -f $(bindir)/'['
  51.  
  52. TAGS: $(SOURCES)
  53.     etags $(SOURCES)
  54.  
  55. clean:
  56.     rm -f $(PROGS) su *.o core
  57.  
  58. mostlyclean: clean
  59.  
  60. distclean: clean
  61.     rm -f Makefile
  62.  
  63. realclean: distclean
  64.     rm -f TAGS
  65.  
  66. dist:
  67.     ln $(DISTFILES) ../`cat ../.fname`/src
  68.  
  69. $(PROGS) su: ../lib/libshu.a version.o
  70.  
  71. basename: basename.o
  72.     $(CC) $(LDFLAGS) -o $@ basename.o ../lib/libshu.a version.o $(LIBS)
  73.  
  74. date: date.o
  75.     $(CC) $(LDFLAGS) -o $@ date.o ../lib/libshu.a version.o $(LIBS)
  76.  
  77. dirname: dirname.o
  78.     $(CC) $(LDFLAGS) -o $@ dirname.o ../lib/libshu.a version.o $(LIBS)
  79.  
  80. echo: echo.o
  81.     $(CC) $(LDFLAGS) -o $@ echo.o ../lib/libshu.a version.o $(LIBS)
  82.  
  83. env: env.o
  84.     $(CC) $(LDFLAGS) -o $@ env.o ../lib/libshu.a version.o $(LIBS)
  85.  
  86. expr: expr.o
  87.     $(CC) $(LDFLAGS) -o $@ expr.o ../lib/libshu.a version.o $(LIBS)
  88.  
  89. false: false.sh
  90.     rm -f $@
  91.     cp $(srcdir)/false.sh false
  92.  
  93. id: id.o
  94.     $(CC) $(LDFLAGS) -o $@ id.o ../lib/libshu.a version.o $(LIBS)
  95.  
  96. groups: groups.sh
  97.     rm -f $@
  98.     sed "s,@bindir@,$(bindir),g" $(srcdir)/groups.sh > $@
  99.     chmod +x $@
  100.  
  101. logname: logname.o
  102.     $(CC) $(LDFLAGS) -o $@ logname.o ../lib/libshu.a version.o $(LIBS)
  103.  
  104. nohup: nohup.sh
  105.     rm -f $@
  106.     sed "s,@bindir@,$(bindir),g" $(srcdir)/nohup.sh > $@
  107.     chmod +x $@
  108.  
  109. pathchk: pathchk.o
  110.     $(CC) $(LDFLAGS) -o $@ pathchk.o ../lib/libshu.a version.o $(LIBS)
  111.  
  112. printenv: printenv.o
  113.     $(CC) $(LDFLAGS) -o $@ printenv.o ../lib/libshu.a version.o $(LIBS)
  114.  
  115. # Link with -lm in case strtod.o needs to get `pow'.
  116. printf: printf.o
  117.     $(CC) $(LDFLAGS) -o $@ printf.o ../lib/libshu.a version.o $(LIBS) -lm
  118.  
  119. sleep: sleep.o
  120.     $(CC) $(LDFLAGS) -o $@ sleep.o ../lib/libshu.a version.o $(LIBS)
  121.  
  122. su: su.o
  123.     $(CC) $(LDFLAGS) -o $@ su.o ../lib/libshu.a version.o $(LIBS)
  124.  
  125. tee: tee.o
  126.     $(CC) $(LDFLAGS) -o $@ tee.o ../lib/libshu.a version.o $(LIBS)
  127.  
  128. test: test.o
  129.     $(CC) $(LDFLAGS) -o $@ test.o ../lib/libshu.a version.o $(LIBS)
  130.  
  131. true: true.sh
  132.     rm -f $@
  133.     cp $(srcdir)/true.sh true
  134.  
  135. tty: tty.o
  136.     $(CC) $(LDFLAGS) -o $@ tty.o ../lib/libshu.a version.o $(LIBS)
  137.  
  138. who: who.o
  139.     $(CC) $(LDFLAGS) -o $@ who.o ../lib/libshu.a version.o $(LIBS)
  140.  
  141. whoami: whoami.o
  142.     $(CC) $(LDFLAGS) -o $@ whoami.o ../lib/libshu.a version.o $(LIBS)
  143.  
  144. yes: yes.o
  145.     $(CC) $(LDFLAGS) -o $@ yes.o ../lib/libshu.a version.o $(LIBS)
  146.  
  147. nice: nice.o
  148.     $(CC) $(LDFLAGS) -o $@ nice.o ../lib/libshu.a version.o $(LIBS)
  149.  
  150. stty: stty.o
  151.     $(CC) $(LDFLAGS) -o $@ stty.o ../lib/libshu.a version.o $(LIBS)
  152.  
  153. uname: uname.o
  154.     $(CC) $(LDFLAGS) -o $@ uname.o ../lib/libshu.a version.o $(LIBS)
  155.  
  156. # Special rules for some .o files.
  157.  
  158. su.o: su.c
  159.     $(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) -DSYSLOG_FAILURE -DSYSLOG_SUCCESS -I$(srcdir)/../lib $(srcdir)/su.c
  160.  
  161. test.o: test.c
  162.     $(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) -DTEST_STANDALONE -I$(srcdir)/../lib $(srcdir)/test.c
  163.  
  164. env.o id.o nice.o pathchk.o stty.o su.o tty.o uname.o who.o: ../lib/getopt.h
  165. expr.o: ../lib/regex.h
  166.  
  167. # Prevent GNU make v3 from overflowing arg limit on SysV.
  168. .NOEXPORT:
  169.